package me.youline.dataServer.dao;


import java.util.Collection;

import me.youline.dataServer.entity.PublicMessage;

import org.perf4j.aop.Profiled;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface PubMsgDAO extends JpaRepository<PublicMessage, Long>{
	
	@Modifying(clearAutomatically=true)
	@Query("delete from  PublicMessage a where a.id in ?1")
	@Profiled(tag = "dao-根据id批量删除公告实体")
	public void deletePublicMessageInIds(Collection<Long> ids);
	
	@Query(" select  m from PublicMessage m where m.id= ?1")
	@Profiled(tag = "dao-根据公告id获取消息实体")
	public PublicMessage findByPubMsgId(Long msgId);
	

}
